package homework.day01;

public class Test01 {
    public static void main(String[] args) {
        String extByName = getExtByName("name.png");
        System.out.println(extByName);
    }


    public static String getExtByName(String name){
        //找到.所在位置的
        int index = name.lastIndexOf('.');
        String subName = name.substring(index + 1);

        return subName;

    }
}
